package me.CSmethod.demo.lianxi;

public class Text4 {
    public static void main(String[] args) {
        int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
        int copya[] = copyOfRange(a, 3, 7);
        for (int i = 0; i < copya.length; i++) {
            System.out.println(copya[i]);
        }
    }
    public static int[] copyOfRange(int a[], int form, int to) {
        int b[] = new int[to - form];
        int count = 0;
        for (int i = form; i < to; i++) {
            b[count] = a[i];
            count++;
        }
        return b;
    }
}

